<template>
	<view class="shiming-box">
		<view class="box">
			<view class="row">
				<view class="left">
					标题
				</view>
				<view class="right">
					<input class="title-input" type="text" placeholder="请输入" />
				</view>
			</view>	
			<view class="row">
				<view class="left">
					任务类型
				</view>
				<view class="uni-list-cell-db chooseInp right">
					<!-- <picker @change="bindPickerChange" :value="index" :range="array"> -->
					<picker @change="bindPickerChange" :range="array">
						<view class="uni-input chooseWay ">{{oper_Id}}</view>
					</picker>
					<image class=" xiala" src="../../../static/image/my/xiala.png" mode=""></image>
				</view>
			</view>
			
			<view class="row">
				<view class="left">
					开始日期
				</view>
				<view class="uni-list-cell-db chooseInp right">
					<picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindDateChange">
						<view class="uni-input visitDate ">{{date}}</view>
					</picker>
					<image class="date" src="../../../static/image/my/reqi.png" mode=""></image>
				</view>
			</view>
			<view >
				<view class="left content">
					内容
				</view>
				<textarea placeholder="请输入"></textarea>
			</view>
		</view>
		
		<view class="questionBox">
			<view class="question"  @click="toSimufengxianceping">
				<label class="iconfont sub-icon">&#xe66a;</label>提交
			</view>
		</view>
	</view>
</template>

<script>
	import mpvuePicker from '../../../components/mpvue-picker/mpvuePicker.vue';
	import cityData from '../../../common/city.data.js';
	import mpvueCityPicker from '../../../components/mpvue-citypicker/mpvueCityPicker.vue';
	import global_ from '../../../components/tool/RenZhengGlobal';
	export default {
		components:{
			mpvuePicker,
			mpvueCityPicker,
		},
		data() {
			return {
				imgurl:'http://ai.ylcaifu.com/appimg/images/5.0-%E6%88%91%E7%9A%84-%E7%90%86%E8%B4%A2%E5%B8%88/5.1.4-%E5%AE%A2%E6%88%B7%E8%AF%A6%E6%83%85/android/drawable-xhdpi',
				date:'',
				oper_Id:'请选择类型',
				themeColor: '#007AFF',
				mode: '',
				deepLength: 1,
				cityPickerValueDefault: [0, 0, 1],
				
				array: ['市场任务','其他'],
			};
		},
		computed: {
			startDate() {
				return this.getDate('start');
			},
			endDate() {
				return this.getDate('end');
			}
		},
		methods: {
			bindDateChange: function(e) {
				this.date = e.target.value
				this.defaultTipDate='';
			},
			bindPickerChange: function(e) {
				//console.log('picker发送选择改变，携带值为', e.target.value)
				this.index = e.target.value
				this.oper_Id = this.array[this.index];
				this.defaultTipSex='';
			},
			
			onCancel(e) {
				console.log(e)
			},
			onConfirm(e) {
				this.pickerText = e.label
				// console.log('123')
			},
			textChange(evt) {
				this.idCardArray = this.idcardData;
				
				// this.textValue = evt.target.label;
				// console.log('-------------'+idCardArray);
				
			},
			getDate(type) {
				const date = new Date();
				let year = date.getFullYear();
				let month = date.getMonth() + 1;
				let day = date.getDate();
			
				if (type === 'start') {
					year = year - 60;
				} else if (type === 'end') {
					year = year + 2;
				}
				month = month > 9 ? month : '0' + month;;
				day = day > 9 ? day : '0' + day;
				return `${year}-${month}-${day}`;
			}
			// 获取城市
		}
	}
</script>

<style>
	page {
		background: rgb(255, 255, 255);
	}

	.box {
		padding: 0 30upx;
	}

	.row {
		height: 98upx;
		border-bottom: 1px solid rgba(0, 0, 0, 0.1);
		display: flex;
		flex-direction: row;
		align-items: center;
	}
	.chooseWay {
		width: 230px;
	}
	.xiala {
		width: 16px;
		height: 10px;
		margin-top: 13px;
		margin-left: 8px;
	}
	.visitDate {
		width: 220px;
	}
	.date {
		width: 20px;
		height: 18px;
		margin-top: 10px;
		margin-left: 5px;
	}
	
	textarea {
		width: 320px;
		height: 150px;
		border: 1px solid #ccc;
		padding: 5px 5px;
		margin-left: 10px;
		margin-top: 20px;
		color: #666666;
	}
	.content {
		margin: 10px 0;
	}

	.left {
		font-size: 14px;
		font-family:PingFang-SC-Medium;
		font-weight:500;
		color:rgba(51,51,51,1);
		margin-right: 20px;
		flex: 1;
	}
	.right {
		flex: 3;
		display: flex;
		text-align: right;
		color: #666666;
	}
	.title-input {
		width: 100%;
		margin-right: 25px;
	}
	.questionBox {
		display: flex;
		flex-direction: row;
		justify-content: center;
		width: 100%;
		padding: 40upx 0;
		text-align: center;
		margin-top: 80px;

	}

	.question {
		width: 240upx;
		height: 70upx;
		background: linear-gradient(-90deg, rgba(196, 156, 90, 1) 0%, rgba(226, 196, 138, 1) 100%);
		border-radius: 35px;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		color: rgb(255, 255, 255);

	}
	.sub-icon {
		margin-right: 10upx;
	}
</style>

